<link rel="stylesheet" href="${mvcPath}/dacp-lib/bootstrap/css/bootstrap.min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${mvcPath}/dacp-lib/ace/css/ace.min.css" type="text/css" />
<link rel="stylesheet" href="${mvcPath}/dacp-lib/ace/css/font-awesome.css">
<#if ref_files?? >
<include ref_files >
</#if>

<script type="text/javascript" src="${mvcPath}/dacp-lib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="${mvcPath}/dacp-lib/bootstrap/js/bootstrap.min.js"></script>

<script src="${mvcPath}/dacp-lib/cryptojs/aes.js" type="text/javascript"></script>
<script src="${mvcPath}/crypto/crypto-context.js" type="text/javascript"></script>

<script type="text/javascript" src="${mvcPath}/dacp-lib/ace/js/ace.min.js"></script>
<script type="text/javascript" src="${mvcPath}/dacp-lib/ace/js/ace-elements.min.js"></script>
<script type="text/javascript" src="${mvcPath}/dacp-lib/ace/js/ace-extra.min.js"></script>

<div id="meta-profile" class="user-profile">
	<div class="row">
		<div class="api-data col-md-9">
			<ul class="api-data-title col-md-12">
				<li class="api-label"><span>${data.objcnname!''}</span></li>
			</ul>
			<ul class="api-data-descr col-md-12">
				<li class="api-descr">${data.objname!''}</li>
			</ul>
			<ul class="api-data-content col-md-12">
				<li class="api-id">主题 : 
				<span>
				    <i class="fa fa-map-marker light-orange bigger-110"></i> 
					<#if data.topicname?? >
						<#list data.topicname?split("|") as x>  <span>${x}</span> </#list>
					</#if>
				</span>
				</li>
			</ul>
			<ul class="api-data-content col-md-12">
				<li class="api-descr">层次 : <span>${data.level_val!''}</span></li>
				<li class="api-request-method">周期 : <span>${data.cycletype!''}</span></li>
			</ul>
			<ul class="api-data-footer col-md-12">
				<li><span class="glyphicon glyphicon-time" aria-hidden="true"></span>
					<span class="CREATE_DT">
						${data.create_date}</span></li>
			</ul>
		</div>
		<div class="col-md-3">
			<div class="button-group">
			    <span id="openSecure">
			        <!-- <a target="_blank" href="ftl/datams/policies/meta_policy_editor?id=${data.xmlid}">
				        <i class="ace-icon fa fa-wrench bigger-120"></i> 打开安全配置
				    </a> -->
			    </span>
			</div>
		</div>
		<!-- /.col -->
	</div>
	<!-- /.row -->
	
	<div class="tabbable row">
		<div class="nav-tabs-div">
			<div class="tabs-content container">
				<ul id="profile-nav" class="nav nav-tabs padding-18">
					<li class="active">
					    <a data-toggle="tab" href="#home"> 
					        <i class="green ace-icon fa fa-book bigger-120"></i> 字段定义
					    </a>
					</li>
					<li>
					    <a data-toggle="tab" href="#feed"> 
					        <i class="orange ace-icon fa fa-key bigger-120"></i> 存储位置
					    </a>
					</li>
				</ul>
			</div>
		</div>

		<div class="tab-content no-border" id="profile-content">
			<div id="home" class="tab-pane in active">
				<div id="field-grid"></div>
			</div>

			<div id="feed" class="tab-pane">
				<#if data.entities?? >
				<#list data.entities as entity >
				<div class="profile-activity clearfix">
					<div>
						<a class="user" href="#"> ${entity.dataname!''} </a>
						${entity.remark!''}
						<span class="badge badge-inverse">${entity.dbname!''}</span>

						<div class="time">
							<i class="ace-icon fa fa-clock-o bigger-110"></i>
							${entity.eff_date!''}
						</div>
					</div>
				</div>
				</#list>
				</#if >
			</div>
<!-- 			/#feed  -->
		</div>
	  
	</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	var fields = new AI.JsonStore({
		sql : "select * from meta_field a where a.xmlid='" + paramMap['id'] + "'",
		loadDataWhenInit : true,
		pageSize : -1
	});
	
	var _rowdblClickFunc = function(){};
	
	var meta_grid = new AI.Grid({
		containerId : 'field-grid',
		store : fields,
		celldblclick:_rowdblClickFunc,
		columns : [
			{ "header" : "字段名", "width" : 70, "dataIndex" : "COLNAME"},
			{ "header" : "中文名", "width" : 80, "dataIndex" : "COLCNNAME"},
			{ "header" : "字段长度", "width" : 80, "dataIndex" : "LENGTH"},
			{ "header" : "是否允许为空", "width" : 101, "dataIndex" : "ISNULLABLE", render:function(rec, val){
				return val==1?'是':'否';
			}},
			{ "header" : "是否主键", "width" : 101, "dataIndex" : "ISPRIMARYKEY", render:function(rec, val){
				return val==1?'是':'否';
			}}
		]
	});
});
</script>
